package com.iwayin.core.bo.category;

import java.util.List;

import com.iwayin.core.bo.SystemCatch;
import com.iwayin.core.dao.category.CategoryDAO;
import com.iwayin.core.dataobject.CategoryDO;

public class CategoryBOImpl implements CategoryBO {
	
	private CategoryDAO categoryDAO;

	@Override
	public List<CategoryDO> listCategory() {
		if(SystemCatch.getCatesList().size()==0){
			SystemCatch.addCateList(categoryDAO.listCategory());
		}
		return SystemCatch.getCatesList();
	}
	
	@Override
	public CategoryDO getCategoryById(Long id) {
		return categoryDAO.getCategoryById(id);
	}

	public void setCategoryDAO(CategoryDAO categoryDAO) {
		this.categoryDAO = categoryDAO;
	}


}
